package {{package}};

{{#imports}}import {{import}};
{{/imports}}

import cn.featherfly.api.serialization.JsonUtils;
import com.fasterxml.jackson.annotation.JsonProperty;
{{#models}}

{{#model}}{{#description}}
/**
 * {{description}}
 **/{{/description}}

/**
 * {{{description}}}
 */
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
  {{#vars}}{{#isEnum}}
  public enum {{datatypeWithEnum}} {
    {{#allowableValues}}{{#values}} {{.}}, {{/values}}{{/allowableValues}}
  };
  @JsonProperty("{{name}}")
  private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{^isEnum}}
  @JsonProperty("{{name}}")
  private {{{datatype}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{/vars}}

  {{#vars}}
  /**{{#description}}
   * {{{description}}}{{/description}}{{#required}}
   * required:{{required}}{{/required}}{{#minimum}}
   * minimum: {{minimum}}{{/minimum}}{{#maximum}}
   * maximum: {{maximum}}{{/maximum}}
   **/
  public {{{datatypeWithEnum}}} {{getter}}() {
    return {{name}};
  }
  public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
    this.{{name}} = {{name}};
  }

  {{/vars}}

  @Override
  public String toString()  {
    return JsonUtils.toJSONString(this);
  }
}
{{/model}}
{{/models}}
